package com.briup.cms.dao;
import com.briup.cms.bean.Category;
import org.apache.ibatis.annotations.*;
import java.util.List;


public interface CategoryMapper {
    @Select("select * from category")
    List<Category> selectAll();
    @Results(
            @Result(column ="parent_id",property="parentId")
    )
    @Insert("insert into category values(null,#{name},#{introduce},#{nu},#{parentId})")
    void insert(Category category);

    @Update("update category set name=#{name},introduce=#{introduce},nu=#{nu},parent_id=#{parentId} where id=#{id}")
    void update(Category category);

    @Delete("delete from category where id = #{id}")
    void deleteById(long id);
}

